<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--jstl을 쓰기 위해 사용 --%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %><%--숫자 포맷을 사용하기 위해 사용 --%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%><%--함수들을 이용하기 위해 사용 --%>   
<%@ taglib prefix="c-rt" uri="http://java.sun.com/jstl/core_rt" %>  <%-- ie버전 확인에 쓰기 위해 씀 --%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>위협목록작성</title>
<link href="reset.css" rel="stylesheet" type="text/css" />
<link href="style.css" rel="stylesheet" type="text/css" />
<!--말 줄임 css(모든 브라우저 적용)-->
<style type="text/css">
.ellipsis{
	white-space:nowrap;
	text-overflow:ellipsis;		/* IE, Safari */
	-o-text-overflow:ellipsis;		/* Opera under 10.7 */
	overflow:hidden;			/* "overflow" value must be different from "visible" */ 
	-moz-binding: url('ellipsis.xml#ellipsis');
}
</style>

<script type="text/javascript" src="script/sms_util_script.js"></script>
<script type="text/javascript" src="script/sms_riskI_script.js"></script>
<script type="text/javascript">
function winClose(){
	window.close();
}
</script>
</head>
<body>

<c:if test="${sessionScope.USER_ID==null}">
		<script type="text/javascript">
			alert("연결이 끊어졌습니다. 다시 로그인 해주시기 바랍니다");
			window.close();
		</script>	
</c:if>
<div class="box">
        <div class="box-container1">     		
      		<h4 class="white">
      			<span class="align-left">위협목록 생성</span>
	      		<span class="align-right">상태 :
		      		<c:choose>
		      			<c:when test="${sessionScope.magamSession[2].state =='Y'}">
		      				 마감
		      			</c:when>
		      			<c:otherwise>
		      				 착수
		      			</c:otherwise>
		      		</c:choose>
	      		</span>
      		</h4>
        <form action="riskIAction.do" method="post" name="mtkind">
			<input type="hidden" name="mode" value="mtlist_insert"></input>
			<input type="hidden" name="pro_id" id="pro_id" value="${sessionScope.lastProId }"></input>
        	<table class="table-short1" style="margin: 0 auto; width: 500px">
      			<tfoot>
      				<tr>
      					<td>
  							<div class="align-left">
	      						<a href="#" class="button1"><span>위협유형</span></a>&nbsp;&nbsp;
	   							<select name="base_lev1" id="base_lev1" class="selectBox" onchange="search_openTkList_base_lev1(this)" style="width: 200px;">
	   								<option value="0"> - 전체 - </option>
									<c:forEach  var="list" items="${requestScope.distinctList}" varStatus="status">
										<option <c:if test="${list.base_lev1 == requestScope.base_lev1 }">selected</c:if> value="${list.base_lev1 }">${list.tk_nm1 }</option>
									</c:forEach>
								</select>
      						</div>
                        	<div class="align-right">
                        	<c:choose>
	                       		<c:when test="${sessionScope.magamSession[2].state !='Y'}">
	                       		<!-- 마감 현황이 유무 판별(Y 시 입력 불가) -->
	                       			<a href="#" class="button" onclick="javascript: mtlistInsert()"><span>저장</span></a>
	                       		</c:when>
	                       		<c:otherwise>
	                       			<a href="#" class="button1 addMargin" onclick="return false;"><span>저장</span></a>
	                       		</c:otherwise>
	                       	</c:choose>
                        		<a href="#" class="button" onclick="javascript: winClose()"><span>닫기</span></a>
                        	</div>
                        </td>
      				</tr>
      				<tr><td class="spaceLine"></td></tr>
      			</tfoot>
      		</table>
      		<table class="table-short1" style="margin: 0 auto; width: 500px">
      			<colgroup>
				<!-- ie67인지 아닌지 판단 (위=ie)(아래는 그외)--> 
					<c-rt:choose>
						<c-rt:when test="${isMSIE67}">
							<col width="41px"/>
							<col width="121px"/>
							<col width="121px"/>
							<col width="21px"/>
							<col width="21px"/>
							<col width="21px"/>
							<col/>
							<col width="15px"/>
						</c-rt:when>
						<c-rt:otherwise>
							<col width="40px"/>
							<col width="120px"/>
							<col width="120px"/>
							<col width="20px"/>
							<col width="20px"/>
							<col width="20px"/>
							<col/>
							<col width="15px"/>
						</c-rt:otherwise>
					</c-rt:choose>				
				</colgroup>
      			<thead>
      				<tr>
      					<td class="col-chk" rowspan="2"><input type='checkbox' name='checkAll' onclick="javascript: selectAll()" class="chkCursor"></input></td>
      					<td class="col-rowspanMid" rowspan="2">위협유형</td>
      					<td class="col-rowspanMid" rowspan="2">위협명</td>
      					<td colspan="3">&nbsp;위협원천</td>
      					<td class="col-rowspanMid" rowspan="2">상세위협</td>
      					<td class="col-rowspanMid" rowspan="2"></td>
					</tr>
					<tr>
						<td style="padding-left: 6px">D</td>
      					<td style="padding-left: 6px">A</td>
      					<td style="padding-left: 7px">E</td>
					</tr>
      			</thead>
      		</table>
      		<div class="scrollDIV" style="width: 500px; height: 345px;">
      		<table class="table-short1" style="margin: 0 auto; width: 500px">
      			<colgroup>
      				<col width="40px"/>
					<col width="120px"/>
					<col width="120px"/>
					<col width="20px"/>
					<col width="20px"/>
					<col width="20px"/>
					<col/>
					<col width="15px"/>
				</colgroup>
      			<tbody>
      				<c:choose>
                    	<c:when test="${fn:length(list)!= 0}">
                       	<c:forEach var="list" items="${requestScope.list}" varStatus="status">
                   			<%--
                   			<tr onmouseover="ChangeBackground(this,'over','${status.index}');" onmouseout="ChangeBackground(this,'out','${status.index}');" class="odd">
                   			 --%>
                   			 <tr <c:if test="${status.index%2==0 }">class="odd"</c:if> onmouseover="ChangeBackground(this,'over','${status.index}');" onmouseout="ChangeBackground(this,'out','${status.index}');">
                   				<td class="col-chk"><input type="checkbox" name="check" id="check${status.index+1 }"  class="chkCursor" value='${list.tk_id}'></input></td>
                    			<td>
                    				<div class="ellipsis"  style="width:100%;" title='${list.tk_nm1 }'>${list.tk_nm1 }</div>
                    			</td>
                    			<td>
                    				<div class="ellipsis"  style="width:100%;" title='${list.tk_nm2 }'>${list.tk_nm2 }</div>
                    			</td>
                    			<td>
                    				<c:choose>
                    				<c:when test="${list.tk_d==1 }">
                    					<img src="img/chkok.gif" />
                    				</c:when>
                    				<c:otherwise>
                    					<img src="img/chkno.gif" />
                    				</c:otherwise>
                    				</c:choose> 
                    			</td>
                    			<td>
                    				<c:choose>
                    				<c:when test="${list.tk_a==1 }">
                    					<img src="img/chkok.gif" />
                    				</c:when>
                    				<c:otherwise>
                    					<img src="img/chkno.gif" />
                    				</c:otherwise>
                    				</c:choose>                     				
                    			</td>
                    			<td>
                    				<c:choose>
                    				<c:when test="${list.tk_e==1 }">
                    					<img src="img/chkok.gif" />
                    				</c:when>
                    				<c:otherwise>
                    					<img src="img/chkno.gif" />
                    				</c:otherwise>
                    				</c:choose>                     				
                    			</td>
                    			<td>
                    				<div class="ellipsis" style="width:100%;" title="${list.tk_nm3 }">${list.tk_nm3 }</div>
                    			</td>
	   					 	<td></td>
                    		</tr>
                    	</c:forEach>
                    	</c:when>
                    	<c:otherwise>
                    		<tr class="odd">
								<td colspan="8"  class="noDataTD">-데이터가 없습니다-</td>
							</tr>
                    	</c:otherwise>
                    	</c:choose>
      			</tbody>
      		</table>  
    		</div>
     		</form>	
  		</div><!-- end of div.box-container1 -->
</div> <!-- end of div.box -->
</body>
</html>